package converter;

import entity.Address;
import org.springframework.core.convert.converter.Converter;

public class StringToAddressConverter implements Converter<String, Address> {
    @Override
    public Address convert(String source) {
        Address address=new Address();

        String[] s=source.split("-");

        address.setProvince(s[0]);
        address.setCity(s[1]);

        return address;
    }
}
